package cn.iocoder.yudao.module.wine.dal.mysql.complaintype;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.complaintype.ComplainTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.complaintype.vo.*;

/**
 * 投诉信息类型 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ComplainTypeMapper extends BaseMapperX<ComplainTypeDO> {

    default PageResult<ComplainTypeDO> selectPage(ComplainTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ComplainTypeDO>()
                .likeIfPresent(ComplainTypeDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(ComplainTypeDO::getStatus, reqVO.getStatus())
                .eqIfPresent(ComplainTypeDO::getVisible, reqVO.getVisible())
                .eqIfPresent(ComplainTypeDO::getSort, reqVO.getSort())
                .betweenIfPresent(ComplainTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ComplainTypeDO::getScore, reqVO.getScore())
                .orderByDesc(ComplainTypeDO::getSort));
    }

}
